/**@(#)SampleManager.java*/ 
package com.feng.designpattern.Singleton;
/** 
  <code>SampleManager</code> is a sample displaying usage of singleton design pattern. 
  This is pre initialized implementation. 
  @author quickpoint 
  @version 1.0 02/25/2005 
*/ 
public class SampleManager 
{ 
  /** Only one instance( pre initialized )*/ 
  private static SampleManager instance = new SampleManager(); 
  
  /** Constructor 
  In a private domain to ensure that could not be initialized by outter. 
  */ 
  private SampleManager() 
  { 
  	System.out.println("This is a sample manager."); 
  } 
  
  public synchronized static SampleManager getInstance() 
  { 
  	return instance;   
  } 
  
  // Display how to use 
  public static void main( String[] args ) 
  { 
  	SampleManager manager = SampleManager.getInstance(); 
  } 
} 
